home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / easyx / data1.cab / Example_Files / Tutorial / Tutorial2 / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-11-03  |  4.0 KB  |  129 lines

  1. VERSION 5.00
  2. Object = "{5A65A9C0-089F-11D2-88AD-0000B45C4CF6}#1.0#0"; "EASYX.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   2430
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   4485
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   2430
  11.    ScaleWidth      =   4485
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.Frame Frame2 
  14.       Caption         =   "Streaming sounds"
  15.       Height          =   2175
  16.       Left            =   2400
  17.       TabIndex        =   4
  18.       Top             =   120
  19.       Width           =   1935
  20.       Begin VB.CommandButton cmdStopStream 
  21.          Caption         =   "Stop Streaming Sound"
  22.          Enabled         =   0   'False
  23.          Height          =   495
  24.          Left            =   360
  25.          TabIndex        =   6
  26.          Top             =   1200
  27.          Width           =   1215
  28.       End
  29.       Begin VB.CommandButton cmdStream 
  30.          Caption         =   "Play Streaming sound"
  31.          Height          =   495
  32.          Left            =   360
  33.          TabIndex        =   5
  34.          Top             =   480
  35.          Width           =   1215
  36.       End
  37.    End
  38.    Begin VB.Frame Frame1 
  39.       Caption         =   "Static sounds"
  40.       Height          =   2175
  41.       Left            =   120
  42.       TabIndex        =   0
  43.       Top             =   120
  44.       Width           =   1815
  45.       Begin VB.CommandButton cmdStaticPlayDup 
  46.          Caption         =   "Play Duplicate"
  47.          Enabled         =   0   'False
  48.          Height          =   495
  49.          Left            =   240
  50.          TabIndex        =   3
  51.          Top             =   1440
  52.          Width           =   1215
  53.       End
  54.       Begin VB.CommandButton cmdStaticDuplicate 
  55.          Caption         =   "Duplicate Static sound"
  56.          Height          =   495
  57.          Left            =   240
  58.          TabIndex        =   2
  59.          Top             =   840
  60.          Width           =   1215
  61.       End
  62.       Begin VB.CommandButton cmdStatic 
  63.          Caption         =   "Play &Static sound"
  64.          Height          =   495
  65.          Left            =   240
  66.          TabIndex        =   1
  67.          Top             =   240
  68.          Width           =   1215
  69.       End
  70.    End
  71.    Begin PROJECTEXLibCtl.EasyX EasyX1 
  72.       Left            =   1320
  73.       OleObjectBlob   =   "Form1.frx":0000
  74.       Top             =   600
  75.    End
  76. Attribute VB_Name = "Form1"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Dim StaticSound As Long
  83. Dim StaticDuplicate As Long
  84. Dim StreamSound As Long
  85. Private Sub cmdStatic_Click()
  86. EasyX1.PlayStaticSound StaticSound, 0
  87. End Sub
  88. Private Sub cmdStaticDuplicate_Click()
  89. StaticDuplicate = EasyX1.DuplicateStaticSound(StaticSound)
  90. cmdStaticPlayDup.Enabled = True
  91. End Sub
  92. Private Sub cmdStaticPlayDup_Click()
  93. EasyX1.PlayStaticSound StaticDuplicate, 0
  94. End Sub
  95. Private Sub cmdStopStream_Click()
  96. cmdStopStream.Enabled = False
  97. EasyX1.StopStreamingSound StreamSound
  98. End Sub
  99. Private Sub cmdStream_Click()
  100. EasyX1.PlayStreamingSound StreamSound, 0
  101. cmdStopStream.Enabled = True
  102. End Sub
  103. Private Sub Form_Load()
  104. Dim rt As Long
  105. Dim AppPath As String
  106. '''do not forget this
  107. EasyX1.Window = Me.hWnd
  108. ''''''''''''''''''''''''
  109. 'initialize sound
  110. rt = EasyX1.InitializeSound()
  111. If rt <> EX_OK Then
  112.     MsgBox "Sound could initialize", vbOKOnly
  113.     Unload Me
  114.     Exit Sub
  115. End If
  116. AppPath = App.Path & "\"
  117. 'load sounds
  118. StaticSound = EasyX1.CreateStaticSound(AppPath & "boink.wav")
  119. If StaticSound < 0 Then
  120.     MsgBox "Static sound could not be loaded", vbOKOnly
  121.     cmdStatic.Enabled = False
  122. End If
  123. StreamSound = EasyX1.CreateStreamingSound(AppPath & "countdown.wav")
  124. If StreamSound < 0 Then
  125.     MsgBox "Static sound could not be loaded", vbOKOnly
  126.     cmdStream.Enabled = False
  127. End If
  128. End Sub
  129.